package com.wanglin.reggie.config;

/**
 * MyBatisPlusConfig
 *
 * @author 王林
 * @version 1.0
 * @description
 * @date 2025/5/28 15:28
 * @projectName reggie_take_out
 * @package com.wanglin.reggie.config
 * @className com.wanglin.reggie.config.MyBatisPlusConfig
 * @copyright Copyright 2020 Theofanis, Wang Lin All rights reserved.
 */

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * MyBatisPlus配置类
 * 分页插件
 */
@Configuration
public class MyBatisPlusConfig {
    //配置分页插件
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return mybatisPlusInterceptor;
    }
}
